#ifndef OPENCLEXCEPTION_H
#define OPENCLEXCEPTION_H

#include <exception>
#include <CL/cl.hpp>

/// Exception class for OpenCL errors
class OpenCLException : public std::exception
{
    cl_int _errorCode;
    std::string _errorText;
public:
    OpenCLException(const cl_int errorCode, const std::string errorText) throw();
    virtual const char* what() const throw()
    {
        return _errorText.c_str();
    }

    cl_int error_code() const
    {
        return _errorCode;
    }
    ~OpenCLException() throw() {}
};

#endif // OPENCLEXCEPTION_H
